<template>
<el-container class="share">
  <el-main>
    <back></back>
    <ul>
      <li>
        <p>我获得的认证奖励: <b>{{memberTime}}</b></p>
      </li>
      <li>
        <h2><i>邀请好友</i><b>你与好友均得认证服务奖励</b></h2>
        <p>每邀请1位新用户购买云商汇平台认证服务，推荐人和被推荐人均可获得购买等值的认证服务奖励。
          奖励的认证服务直接加到您的诚信会员认证里。 例如：A推荐B，B购买了一年的认证服务，则A和B均
          获得一年的免费认证服务奖励。 注：被推荐人注册填写推荐人的推荐码才可享有奖励， 仅第一次购买认证服务有此奖励</p>
      </li>
      <li>
        <span><p>我的邀请码</p><b>{{code}}</b></span>
      </li>
    </ul>
  </el-main>
</el-container>
</template>

<script>
  import back from '@/components/back'
  import qs from 'qs'
    export default {
      data(){
        return{
          code:'',
          yearTime:'',
          id:'',
          memberTime:''
        }
      },
      computed:{
        id(){
          return this.$store.state.merchantId

        }
      },
       mounted(){
        this.id = localStorage.getItem("merchantId");
        // this.code =
         let params = {
           merchantId:this.id
         }
         this.$axios.post('/api/front/merchant/checkMerchantStatus',qs.stringify(params))
           .then(res => {
             this.code = res.data.obj.invitationCode
           })
         this.$axios.post('api/front/order/share',qs.stringify({merchantId:this.id}))
           .then(res => {
             this.memberTime = res.data.obj;
           })
       },
      components:{
        back,
      }
    }
</script>

<style scoped lang="scss">
.el-container{
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #DCDFE6;
  ul{
    li{
      padding: 20px 0 ;
      background: #fff;
      margin: 10px 0;
      box-shadow: 2px 2px 4px #999;
      display: flex;
      &:nth-child(1){
        flex-direction: row;
        justify-content: flex-start;
        p{
          margin: 5px 0;
          padding-left: 15px;
          font-size: 16px;
        }
      }
      &:nth-child(2){
        flex-direction: column;
        justify-content: center;
        h2{
          margin-top: 0;
          i{
            font-weight: bold;
            margin-right: 15px;
          }
          b{
            font-weight: bold;
          }
        }
        p{
          padding: 0 20px;
          text-align: left;
          text-indent:24px;
          font-size: 14px;
          line-height: 20px;
        }
      }
      &:nth-child(3){
        display: flex;
        flex-direction: row;
        justify-content: center;
        span{
          display: flex;
          flex-direction: column;
          justify-content: center;
          p{
            font-size: 18px;
            margin-top: 0;
          }
          b{
            padding: 10px 20px;
            background: #ff9900;
            color: #fff;
            font-size: 18px;
            border-radius: 6px;
          }
        }


      }
    }
  }
}
</style>
